<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>29-数字toFixed方法</title>
</head>
<body>
    <script>
        // 数字toFixed方法
        const num = 123.42389489
        console.log(num)
        console.log(num.toFixed(2)) // 123.42
        console.log(num.toFixed(1)) // 123.4

        const num1 = 123
        console.log(num1.toFixed(2)) // 123.00
        

        
    </script>
</body>
</html>